package com.hyj.springcloud.service;

import com.hyj.springcloud.entities.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 下面先写个接口,
 * 想用provider模块中a方法,所以用@FeignClient(与微服名关联起来)
 * 下面就把a方法名"伪装出来".
 */
@Component
//默认timout是1秒
@FeignClient("cloud-provider-service")
public interface PaymentFeignService {
    @GetMapping("/payment/get/{id}")
    public CommonResult getPaymentById(@PathVariable("id") Long id);
}
